package com.fund.datacopy.task.thread;

import com.fund.datacopy.utils.DataCopyUtil;
import com.mongodb.BasicDBObject;
import com.mongodb.DBCollection;

public class Worker implements Runnable {
	private DBCollection src;
	private DBCollection dest;
	private BasicDBObject q;

	public Worker() {
	}

	public Worker(DBCollection src, DBCollection dest, BasicDBObject q) {
		this.src = src;
		this.dest = dest;
		this.q = q;
	}

	public DBCollection getSrc() {
		return this.src;
	}

	public void setSrc(DBCollection src) {
		this.src = src;
	}

	public DBCollection getDest() {
		return this.dest;
	}

	public void setDest(DBCollection dest) {
		this.dest = dest;
	}

	public BasicDBObject getQ() {
		return this.q;
	}

	public void setQ(BasicDBObject q) {
		this.q = q;
	}

	public void run() {
		System.out.println("start copy...");
		DataCopyUtil.copy(this.src, this.dest, this.q);
	}
}
